@extends('admin/layout/index')

@section('title')
    商品添加
@endsection

@section('content')

<!-- 配置文件 -->
<script type="text/javascript" src="/ue/ueditor.config.js"></script>

<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/ue/ueditor.all.js"></script>

<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span>商品添加</span>
    </div>
    <div class="mws-panel-body no-padding">
    	<form class="mws-form" action="/admin/goods/insert" method="post" enctype="multipart/form-data">
            {{ csrf_field() }}
    		<div class="mws-form-inline">
                 <div class="mws-form-row">
                    <label class="mws-form-label">商品类型</label>
                    <div class="mws-form-item">
                        <select class="large" name="cid" style="width:490px">
                            <option>--请选择--</option>
                            @foreach($data as $k => $v)
                            <option value="{{ $v['cid'] }}" @if($cid == $v['cid']) selected @endif>{{ $v['name'] }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
    			<div class="mws-form-row">
    				<label class="mws-form-label">商品名称</label>
    				<div class="mws-form-item">
    					<input type="text" class="small" name="gname">
    				</div>
    			</div>
    			<div class="mws-form-row">
    				<label class="mws-form-label">商品价格</label>
    				<div class="mws-form-item">
    					<input type="text" class="small" name="gprice">
    				</div>
    			</div>
    			<div class="mws-form-row">
    				<label class="mws-form-label">商品图像</label>
    				<div class="mws-form-item">
    					<input type="file" value="" class="small" name="gpic">
    				</div>
    			</div>
                <div class="mws-form-row">
                    <label class="mws-form-label">商品库存</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="gcount">
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">商品销量</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="gsold">
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">商品描述</label>
                    <div class="mws-form-item">
                        <!-- <input type="text" class="small" name="gdesc"> -->
                       <script id="container" name="gdesc" type="text/plain">
                                                
                       </script>
                    </div>
                </div>
               <div class="mws-form-row">
                    <label class="mws-form-label">商品状态</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="gstatus">
                    </div>
                </div>
    		</div>
    		<div class="mws-button-row">
    			<input type="submit" value="提交" class="btn btn-danger">
    			<input type="reset" value="重置" class="btn ">
    		</div>
    	</form>
    </div>    	
</div>
<!-- 实例化编辑器 -->
<script type="text/javascript">
         window.onload=function(){var ue = UE.getEditor('container');}
</script>
@endsection